﻿using System;
using System.Collections.Generic;
using System.Linq;
using TuxedoLib;

namespace SpaceSquirrel.SpriteRenderers
{
	class PowerUpRenderer : SpriteRenderer
	{
		public override void Render(Sprite sprite, PlayScene scene, Image screen, int offsetX, int offsetY, int renderCounter)
		{
			Automation.PowerUpAutomation pua = sprite.automation as Automation.PowerUpAutomation;
			if (pua.visible)
			{
				int left = sprite.x + offsetX - 8;
				int top = sprite.y + offsetY - 8;
				string type = sprite.powerUpInfo.Type;
				string path;
				if (type == "1up")
				{
					path = "sprites/1up.png";
				}
				else if (type == "life_small")
				{
					path = "sprites/life_small.png";
				}
				else if (type == "life_big")
				{
					path = "sprites/life_big.png";
				}
				else
				{
					return;
				}

				screen.Blit(ImageLibrary.GetImage(path), left, top);
			}
		}
	}
}
